const buf = Buffer.from('runoob', 'ascii');

/*1.创建*/
const  buff1 = Buffer.alloc(10);
const buff2 = Buffer.allocUnsafe(10);
const buff3 = Buffer.from('ddddddd','latin1');

/*2.写入*/
buff1.write('dd');

for (var i=0;i<10;i++){
    buff2[i]=i+97;
}

/*3.读取*/
console.log(buff2.toJSON());

/*转码运算*/
console.log(buff2.toString('base64'));




